import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TestService {


    private static int path;

    private String changePath1(List<Integer> pathList) {

        String returnPath = "";
        for (Integer a : pathList) {
            returnPath = returnPath + a.toString();
        }
        return returnPath;
    }

    private String changePath2(List<Integer> pathList) {

        StringBuilder returnPath = new StringBuilder();
        for (Integer a : pathList) {
            returnPath.append(a.toString());
        }
        return returnPath.toString();
    }

    private String changePath3(List<Integer> pathList) {

        StringBuffer returnPath = new StringBuffer();
        for (Integer a : pathList) {
            returnPath.append(a.toString());
        }
        return returnPath.toString();
    }

//    public String path = "a";

    
    public static String changePath5() {
        StringBuilder returnPath = new StringBuilder(path);

        List<Integer> pathList = new ArrayList<>();
        pathList.add(1);
        for (Integer a : pathList) {
           returnPath.append(a);
        }
        return returnPath.toString();
    }

    private String changePath6() {

        String returnPath = "";
            returnPath = returnPath + "a.toString()" + "b.ss";

        return returnPath;
    }

    private String changePath7() {

        String returnPath = "";
        String returnPath1 = "1";
        String returnPath2 = "2";
        String returnPath3 = "3";
        String returnPath4 = "4";

//            returnPath = returnPath + returnPath1 + returnPath2 + returnPath3;

            StringBuffer stringBuilder = new StringBuffer(returnPath);
            stringBuilder.append(returnPath1).append(returnPath2);
returnPath = stringBuilder.toString();
        return returnPath;
    }

    public static void main(String[] args) {
        System.out.println(changePath5());
    }


}
